<?php
/**
 * Created by PhpStorm.
 * User: dy
 * Date: 2020/1/9
 * Time: 17:22
 */
namespace app\admin\model;
use app\common\model\BaseModel;

class AdminActionLogModel extends BaseModel
{
    protected $name = 'AdminActionLog';
    public static function logAdd($name,$content = ''){
        $request = request();
        $data = [
            'admin_id'=>app('admin_auth')->id,
            'name'=>$name,
            'content'=>$content,
            'ip'=>$request->ip(),
            'url'=>$request->baseUrl()
        ];
        self::create($data);
    }
    public function Admin(){
        return $this->belongsTo('Admin','admin_id');
    }
}